<%layout("/common/g_layout.html"){%>

<div class="container-fluid content">
    <div class="row">
        <div class="col-md-7 left pc-topic" data-topicid="${topics.id}">
            <div class="tit">${topics.name}
                <%if(iscreater==1){%>
                <a href="/topic/deleteTopic?id=${topics.id}"><button class="btn btn-danger pull-right" style="margin-right: 10px">删帖</button></a>
                <%}%>
            </div>
            <div class="user-and-time">
                <div class="profile"><img src="../images/show.jpg" class="img-circle" height="64" width="64" alt=""></div><span class="user">${topics.author_id}</span><span class="time">${printTime(topics.update_time)}</span></div>
            <div class="main-content">
                ${topics.topic_text}
            </div>
        </div>
        <div class="col-md-4 col-md-offset-1 right">
            <div class="team-sim-intro">
                <div class="img">
                    <img src="${group.imageurl}" height="60" width="60" alt="">
                </div>
                <div class="saying">
                    <p class="p1">${group.name}</p>
                    <p class="p2">(一个爱设计的孩纸)</p>
                </div>
            </div>
            <div class="join-info">
                <span class="numbers">${group.num}人加入了这个小组</span>
                <button type="button" class="btn btn-default btn-sm pull-right" disabled="disabled"><span style="color: gray;" class="glyphicon glyphicon-thumbs-up"></span>加入小组</button>
                <span class="is-in-team" style="display: none">你已经是小组成员</span>
            </div>
            <div class="newest-theme">
                <div class="tit">
                    <div class="pull-left">最新话题</div>
                    <div class="pull-right"><a href="/group/toHotTopic" title="more">more</a></div>
                    <div class="clear-fix"></div>
                </div>
                <div class="content-box">
                    <%
                    for(topic in topicnow.list){
                    %>
                    <div class="topic-title-and-author">
                        <a href="/topic/goTopic?id=${topic.id}" class="topic-title">${topic.name}</a>
                        <span class="topic-author">${topic.id}</span>
                    </div>
                    <%}%>

                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-7 inter-box">
            <div class="cont pc-comments">
                <%
                for(comment in comments.list){
                %>
                <div class="row">

                    <div class="img-name-time">
                        <div class="col-md-1">
                            <img src="../images/profile.png" height="40" width="40" class="img-circle">
                        </div>
                        <div class="col-md-4" style="background: #f0f6f3;color: black;font-size: 13px;">${comment.user_id}</div>
                        <div class="time col-md-7" style="background: #f0f6f3;">${printTime(comment.comment_time)}</div>
                    </div>
                    <div class="response-cont col-md-12">
                        <form class="col-md-offset-1" id="res-form">
                            <div class="form-group">
                                <p class="col-md-10">${comment.comment_text}</p>
                                <%if(iscreater==1){%>
                                <a href="/topic/deleteComment?id=${comment.id}"><button type="button" class="btn btn-danger">删帖</button></a>
                                <%}%>
                                <div class="clear-fix"></div>
                            </div>
                        </form>
                    </div>
                </div>
                <%}%>

            </div>
            <nav>
                <button type="button" class="btn btn-success btn-sm col-md-1" id="res-to-post">回应</button>
                <a href="/topic/toZanTopic?id=${topics.id}"><button type="button" class="btn btn-danger btn-sm col-md-1 col-md-offset-1">点赞<span class="glyphicon glyphicon-thumbs-up">+1</span></button></a>
                <ul class="pager pc-page">
                    <li><button class="btn btn-info pc-prev" disabled>上一页</button></li>
                    <li><button class="btn btn-info pc-next">下一页</button></li>
                </ul>
            </nav>
        </div>
        <div class="col-md-5"></div>
        <div class="col-md-7" style="padding-left: 0;">
            <div class="add-to-list" style="padding-left: 0;padding-top: 10px;margin-left: 0;">
                <form action="/repeat/addrepeat?id=${topics.id}" method="post">
                <!-- <div class="form-group" style="border: 1px solid black;"> -->
                <!-- <div id="NicEdit" rows="5" cols="80" style="border:1px solid blue;background: red;">Some Text</div> -->
                <textarea id="NicEdit" name="comment_text" rows="8" cols="120"></textarea>
                <!--<button type="submit" class="btn btn-primary add-up" style="margin-top: 10px;" value="加上去"></button>-->
                <button type="submit" class="btn btn-primary add-up" style="margin-top: 10px;">加上去</button>
                </form>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="/group/js/scripts/jquery-2.1.3.min.js"></script>
    <script src="/group/js/scripts/underscore.js"></script>
    <script type="text/javascript" src="/group/js/scripts/nav.js"></script>
    <script type="text/javascript" src="/group/js/scripts/tog.js"></script>
    <script src="http://js.nicedit.com/nicEdit-latest.js"></script>
    <script type="text/javascript">
        bkLib.onDomLoaded(function() {
            new nicEditor().panelInstance('NicEdit');
        });

    </script>

    <!--修改underscore的定界符-->
    <script type="text/javascript">
        _.templateSettings = {
            interpolate: /\{<=([\s\S]+?)>\}/g,
            evaluate: /\{<([\s\S]+?)>\}/g,
            escape: /\{<-([\s\S]+?)>\}/g
        };
    </script>

    <script type="text/template" id="temp-comment">
        {< comments.forEach(function (comment) { >}
        <div class="row">
            <div class="img-name-time">
                <div class="col-md-1">
                    <img src="../images/profile.png" height="40" width="40" class="img-circle"></div>
                <div class="col-md-4" style="background: #f0f6f3;color: black;font-size: 13px;"> {<= comment.user_id >} </div>
                <div class="time col-md-7" style="background: #f0f6f3;">
                    {<= comment.comment_time >}
                </div>
            </div>
            <div class="response-cont col-md-12">
                <form class="col-md-offset-1" id="res-form">
                    <div class="form-group">
                        <p class="col-md-10">{<= comment.comment_text >}</p>
                        {< if(iscreater==1){ >}        
                        <a href={<= "/topic/deleteComment?id=" + comment.id >}>
                            <button type="button" class="btn btn-danger">删帖</button>
                        </a>
                        {< } >}        
                        <div class="clear-fix"></div>
                    </div>
                </form>
            </div>
        </div>
        {< }) >}
    </script>
    <!--<script type="text/javascript">-->
        <!--$(function() {-->
            <!--$('.res-btn,.to-res-btn').click(function() {-->
                <!--$('div.add-to-list').show();-->
                <!--$('.add-up').click(function() {-->
                    <!--var cont = $(".add-to-list textarea").val();-->
                    <!--cont = "选个好地方，选个好时辰";-->
                    <!--// var html = '<div class="form-group"><p class = "add-cont"> ' + cont + ' </p> <button type="button" class = "btn btn-primary pull-right res-btn" onclick="$(\'div.add-to-list\').show();"> 回复 </button> <div class = "clear-fix"> </div> </div>';-->
                    <!--var html = '<div class="row"> <div class="img-name-time"> <div class="col-md-1 col-md-offset-1"> <img src="../images/profile.png" height="40" width="40" class="img-circle"> </div> <div class="col-md-4">一个萌萌的果果</div> <div class="time">2015-5-10 20：13：44</div> </div> <div class="response-cont col-md-offset-1 col-md-11"> <form  id="res-form"> <div class="form-group"> <p class="col-md-offset-1 col-md-9">' + cont + '</p> <button type="button" class="btn btn-danger">删帖</button><button type="button" class="btn btn-primary pull-right res-btn" onclick="$(\'div.add-to-list\').show();">回应</button> <div class="clear-fix"></div> </div> </form> </div> </div>';-->
                    <!--$('div.inter-box div.cont').append(html);-->
                    <!--$('.add-to-list').hide();-->
                <!--});-->
            <!--});-->

            <!--$('#res-to-post').click(function() {-->
                <!--$('div.add-to-list').show();-->
                <!--$('.add-up').click(function() {-->
                    <!--var cont = $(".add-to-list textarea").val();-->
                    <!--cont = "吃着火锅唱着歌儿";-->
                    <!--var html = '<div class="row"> <div class="img-name-time"> <div class="col-md-1"> <img src="../images/profile.png" height="40" width="40" class="img-circle"> </div> <div class="col-md-4">一个萌萌的果果</div> <div class="time">2015-5-10 20：13：44</div> </div> <div class="response-cont col-md-12"> <form id="res-form" class="col-md-offset-1"> <div class="form-group"> <p class="col-md-10">' + cont + '</p> <button type="button" class="btn btn-danger">删帖</button><button type="button" class="btn btn-primary pull-right res-btn" onclick="$(\'div.add-to-list\').show();">回应</button> <div class="clear-fix"></div> </div> </form> </div> </div>';-->
                    <!--$('div.inter-box div.cont').append(html);-->
                    <!--$('.add-to-list').hide();-->
                <!--});-->
            <!--});-->
            <!--$('.add-up').click(function() {-->
                <!--var cont = $(".add-to-list textarea").val();-->
                <!--cont = "翻译翻译，什么叫惊喜？";-->
                <!--// alert(cont);-->
                <!--var html = '<div class="row"> <div class="img-name-time"> <div class="col-md-1"> <img src="../images/profile.png" height="40" width="40" class="img-circle"> </div> <div class="col-md-4">一个萌萌的果果</div> <div class="time">2015-5-10 20：13：44</div> </div> <div class="response-cont col-md-12"> <form class="col-md-offset-1" id="res-form"> <div class="form-group"> <p class="col-md-10">' + cont + '</p> <button type="button" class="btn btn-danger">删帖</button><button type="button" class="btn btn-primary pull-right res-btn" onclick="$(\'div.add-to-list\').show();">回应</button> <div class="clear-fix"></div> </div> </form> </div> </div>';-->
                <!--$('div.inter-box div.cont').append(html);-->
                <!--// $('.add-to-list').hide();-->
            <!--});-->
        <!--});-->

    <!--</script>-->
</div>
<%include("/common/footer.html"){}%>

<%}%>

